import request from './request'

// 设备组合新增
export const deviceComponentAdd = (addDeviceComponent) => {
  return request({
    url: '/deviceComponent/add',
    method: 'post',
    data: addDeviceComponent,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 设备组合修改
export const deviceComponentUpdate = (addDeviceComponent) => {
  return request({
    url: '/deviceComponent/update',
    method: 'post',
    data: addDeviceComponent,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 设备组合详情
export const deviceComponentDetail = (componentId) => {
  return request({
    url: '/deviceComponent/detail',
    method: 'get',
    param: {
      componentId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 设备列表
export const deviceComponentList = (params) => {
  return request({
    url: '/deviceComponent/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

//  设备详情
export const deviceDetail = (deviceId) => {
  return request({
    url: '/device/detail',
    method: 'get',
    param: {
      deviceId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改设备
export const deviceUpdate = (updateDevice) => {
  return request({
    url: '/device/update',
    method: 'post',
    data: updateDevice,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
// 全部设备设备列表
export const deviceGatewayGatewayList = () => {
  return request({
    url: '/deviceGateway/gatewayList',
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
